package com.yenlien.traceyun.control.entity;

import com.yenlien.traceyun.webase.entity.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 贷款信息
 */
@Entity
@Table(name = "t_loan_info")
@Data
public class LoanInfo extends BaseEntity {

    @Column(name = "name", length = 20)
    private String name;     //申请人

    @Column(name = "id_card", length = 255)
    private String idCard;              //生份证号

    @Column(name = "idCardJustImg", length = 255)
    private String idCardJustImg;              //身份证正面

    @Column(name = "idCardBackImg", length = 255)
    private String idCardBackImg;              //身份证反面

    @Column(name = "sharesImg", length = 255)
    private String sharesImg;           //股权图片


    @Column(name = "applyImg", length = 255)
    private String applyImg;           //贷款申请书图片


    @Column(name = "businessImg", length = 255)
    private String businessImg;           //营业执照图片


    @Column(name = "naturalImg", length = 255)
    private String naturalImg;           //资质认定书图片


    @Column(name = "proveImg", length = 255)
    private String proveImg;           //林权证书/土地证书

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;            //申请时间


    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;            //放款时间

    @Column(name = "amount", length = 20)
    private BigDecimal amount;     //放款金额

    @Column(name = "remarks")
    private String remarks;     //申请说明

    @Column(name = "loan_period")
    private int loanPeriod;     //借款期数

    @Column(name = "guarantee_company_name")
    private String guaranteeCompanyName;          //担保公司名称

    @Column(name = "guarantee_company_legal_person")
    private String guaranteeCompanyLegalPerson;          //担保公司法人

    @Column(name = "guarantee_company_legal_person_IdCard")
    private String guaranteeCompanyLegalPersonIdCard;          //担保公司法人身份证

    @Column(name = "businessLicense_num")
    private String businessLicenseNum;              //组织代码

    @Column(name = "contacts_people")
    private String contactsPeople;          //联系人

    @Column(name = "contacts_tel")
    private String contactsTel;         //联系电话

    @Column(name = "mortgage")
    private String mortgage;            //抵押品       1：林权证   2:土地证

    @Column(name = "mortgage_value")
    private String mortgageValue;            //抵押品价值

    @Column(name = "legal_person")
    private String legalPerson;            //所有权利人/土地使用权人

    @Column(name = "area")
    private BigDecimal area;            //面积/使用权面积

    @Column(name = "position")
    private String position;            //座落

    @Column(name = "species")
    private String species;         //林种

    @Column(name = "term")
    private int term = 0;       //土地使用期限/林地使用期限

    @Column(name = "purpose")
    private String purpose;       //（地类）用途

    @Column(name = "usufruct")
    private String usufruct;       //使用权类型

    @Column(name = "land_num")
    private String landNum;         //地号

    @Column(name = "status", length = 5)
    private String status;         //审核状态      0:审核中， 1：已通过  -1：已拒绝

    @Column(name = "bankInfo_id", length = 32)
    private String bankInfoId;         //关联银行id

    @Column(name = "company_id")
    private String companyId;         //公司ID

    @Column(name = "monthly_amount")
    private String monthlyAmount;        //月供

    @Column(name = "rate", length = 255)
    private String rate;            //贷款利率

    @Transient
    private String bankName;     //银行名字

    @Transient
    private String branchBankName;     //支行名字

    @Transient
    private String pid;     //支行上级id

    @Transient
    private String imgPath;

    @Transient
    private BigDecimal surplusAmount;       //剩余还款金额

    @Transient
    private String surplusNum;       //剩余还款金额

    @Transient
    private BigDecimal repaidAmount;

    @Transient
    private String repaymentTime;

    @Transient
    private BigDecimal totalAmount;

    @Transient
    private BigDecimal realAmount;     //实际还款金额
}
